/*

Author   : chaos

FileName : typeid.cpp

Date     : 15/08/17 16:51:48

*/
#include <iostream>
#include <typeinfo>
using namespace std;
class Base
{
public:
    virtual void show()
    { cout << "Base::show() is called!" << endl; }
};


class Derived:public Base
{
    public:
        void show()
        {cout << "Derived::show() is called !" << endl;}
};

int main(int argc ,char *argv[])
{
    Base *Base_ptr = new Derived;

    if(typeid(*Base_ptr) ==  typeid(Derived))
    {
        cout << typeid(*Base_ptr).name() << endl;
    }
    cout << typeid(Base_ptr).name() << endl;
    return 0;
}
